<template>
    <div class="newsinfo-container">
        <!--大标题-->
<!--        <h3 class="title">新闻标题</h3>-->
        <h3 class="title">Take It All In</h3>
        <!--<h3>新闻详情-&#45;&#45;{{$route.params.is}}</h3>-->
        <!--得到新闻详情页的Id,也可以在data里面写-->

        <!--子标题-->
        <p class="subtitle">
            <span>发表时间：2017-08-15</span>
            <span>点击3344次</span>
        </p>
        <hr>
        <!--内容区域-->
        <div class="content">
            <p>Foot long joint
                一英尺的卷烟
                Case full of gin
                一整箱的烈酒
                Every night we black out just to take it all in
                夜夜昏迷 只因吸尽喝空
                Every day we wake up just to do it all again
                日日醒来 只为再次沉沦
                Every night we black out just to take it all in
                日夜昏沉 直至放纵尽兴
                Foot long joint
                一英尺的卷烟
                Case full of gin
                一整箱的烈酒
                Every night we black out just to take it all in
                夜夜昏迷 只因吸尽喝空
                Every day we wake up just to do it all again
                日日醒来 只为再次沉沦
                Every night we black out just to take it all in
                日夜昏沉 直至放纵尽兴

                I remember having no fans
                还记得歌没人听的时候
                Woah damn
                难捱
                Guess I done came a long way
                走到今天实属不易
                I went from nothin'
                从默默无闻
                To somethin'
                到小有名气
                Guess I done came a long way
                能到这里历尽千辛
                I can't stop now
                可是现在还不能停
                I'm always workin'
                我要保持拼命努力
                I know deep down
                心里清楚得很
                That I'm deserving
                全都是我应得的
                Of what I got
                不管是我所拥有的
                Of what I'll get
                还是我将要得到的
                100 on my wrist
                腕上钻表
                30 on my neck (woah)
                颈间金链
                Used to hang rappers on the wall
                曾经给别人巡演打下手
                Now we hang plaques up (yup)
                现在站到台上享尽风光
                Your favorite rapper lookin' at your other favorite rapper
                现在你喜欢的rapper们面面相觑
                Like "damn I think he's really boutta lap us" (woah)
                “妈呀Russ可能真要压过咱们了”
                I spoke to the universe it spoke right back
                我一发声上天都得回一句
                And truthfully I don't even smoke like that
                曾经我不怎么飞叶子
                But I'm with the same people who can tell you where I came from
                但我的交心哥们有这爱好
                So I bought a half a pound for my day ones
                所以我挥手买半斤送给哥们抽

                Foot long joint
                一英尺的卷烟
                Case full of gin
                一整箱的烈酒
                Every night we black out just to take it all in
                夜夜昏迷 只因吸尽喝空
                Every day we wake up just to do it all again
                日日醒来 只为再次沉沦
                Every night we black out just to take it all in
                日夜昏沉 直至放纵尽兴
                Foot long joint
                一英尺的卷烟
                Case full of gin
                一整箱的烈酒
                Every night we black out just to take it all in
                夜夜昏迷 只因吸尽喝空
                Every day we wake up just to do it all again
                日日醒来 只为再次沉沦
                Every night we black out just to take it all in
                日夜昏沉 直至放纵尽兴
                Every night we black out just to take it all in
                日夜昏沉 直至放纵尽兴
                ****** talk down they go wanna see me win
                黑子们说酸话不想看我得意

                I' been on the road
                我在人生旅途奔波已久
                I' been touching souls
                写点旋律词句打动灵魂
                You' been riding waves
                你赚得盆满钵满
                **** around and get exposed
                你四处炫耀露脸
                Nobody put us on
                我却无人问津
                I've just been putting in work like it's fall again
                只能无比拼命生怕再次坠落
                I'm try'na ball out
                我也有资本来炫耀
                Couple barbies in my doll house
                别墅里有几个小妞
                Sippin' hen' to they fall out
                狂灌名酒直到晕厥
                Bounce back
                我卷土重来
                Bounce
                意气风发
                I might just roll up an ounce
                我这就卷上一根
                If you roll up to my crib then don't come without a
                想来我这耍记得也带点

                Foot long joint
                一英尺的卷烟
                Case full of gin
                一整箱的烈酒
                Every night we black out just to take it all in
                夜夜昏迷 只因吸尽喝空
                Every day we wake up just to do it all again
                日日醒来 只为再次沉沦
                Every night we black out just to take it all in
                日夜昏沉 直至放纵尽兴
                Foot long joint
                一英尺的卷烟
                Case full of gin
                一整箱的烈酒
                Every night we black out just to take it all in
                夜夜昏迷 只因吸尽喝空
                Every day we wake up just to do it all again
                日日醒来 只为再次沉沦
                Every night we black out just to take it all in
                日夜昏沉 直至放纵尽兴
            </p>
        </div>

        <!--评论子组件区域-->
        <comment-box :id="this.id"></comment-box><!--父组件向子组件传id-->
    </div>

    <!--以下又是用get请求得到的-->
   <!-- <div class="newsinfo-container">
        <h3 class="title">{{ newsinfo.title }}</h3>
        <p class="subtitle">
            <span>发表时间：{{ newsinfo.add_time | dateFormat }}</span>
            <span>点击：{{ newsinfo.click }}次</span>
        </p>
        <hr>
        &lt;!&ndash;用v-html渲染页面，因为得到的数据带HTML标签&ndash;&gt;
        <div class="content" v-html="newsinfo.content"></div>
    </div>-->
</template>

<script>
//1.导入评论子组件
    import comment from '../subcomponents/comment.vue'

    import {Toast} from 'mint-ui'
    export default {
    data(){
        return{
            id:this.$route.params.id, //将 URL 地址中传递过来的Id值，挂载到data上，方便以后调用
            newsinfo:[]//新闻对象
        };
    },
    create(){
        this.getNewsInfo();
    },
    methods:{
        getNewsInfo(){
            this.$http.get('api/getnew/'+this.id).then(result =>{
                if(result.body.status ===0){
                    this.newsinfo=result.body.message[0];
                }else{
                    Toast('获取新闻失败！')
                }
            })
        }

    },
    components:{//用来注册子组件的节点
        "comment-box":comment
    }
};
</script>

<style lang="scss" scoped>
    .newsinfo-container {
        padding: 0 4px; /*上右*/
        .title {
            font-size: 16px;
            text-align: center;
            margin: 15px 0;
            color: red;
        }

        .subtitle {
            font-size: 13px;
            color: #226aff;
            display: flex; /*缩进*/
            justify-content: space-between; /*两端对齐*/
            .content {
                img{/*图片原本被隐藏了，做了以下设置后，想要显示图片的全部内容，还有去掉scoped*/
                    width:100%;
                }
            }
        }
    }

</style>